package game.chiecnonkydieu2;

import java.util.ArrayList;

import android.annotation.SuppressLint;
import android.app.Activity;
import android.content.res.Resources;
import android.graphics.Point;
import android.os.Bundle;
import android.view.ViewGroup.LayoutParams;
import android.widget.Button;
import android.widget.GridView;

@SuppressLint("NewApi") public class GamePlay extends Activity{
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		super.onCreate(savedInstanceState);
		setContentView(R.layout.play_game);
		Point p= new Point();
		getWindowManager().getDefaultDisplay().getSize(p);
		int w=p.x;
//	
//		Set gridview bang chu
		GridView gridOchu= (GridView) findViewById(R.id.gridOchu);
		gridOchu.setLayoutParams(new LayoutParams(w, w/2));
		Resources res=getResources();
		ArrayList<OchuMod> chars=new ArrayList<OchuMod>();
		for(int i=0;i<50;i++){
			OchuMod chu=new OchuMod();
			chu.imgname=R.drawable.green;
			chars.add(chu);
		}
		Button btnchar=(Button) gridOchu.findViewById(R.id.btnChar);
		OchuAdapter adapter= new OchuAdapter(this, chars, res);
		gridOchu.setAdapter(adapter);
		
		
	}

}
